#ifndef _CAL_H_
#define _CAL_H_

#include <chrono>
#include <map>
#include <vector>

#include "Luly/Music.h"
#include "Luly/SoundEffect.h"
#include "Luly/UI/Button.h"
#include "Luly/UI/HorizontalScrollView.h"
#include "Luly/UI/Panel.h"
#include "Luly/UI/ScrollView.h"
#include "Luly/UI/TextView.h"
class Cal {
 public:
  std::map<std::string, SoundEffect*> soundOP;
  SoundEffect* sound[10];

  TextView* fpsView;
  TextView* textView;
  TextView* textView_formula;  //式子显示
  Button* button1;
  Button* button2;
  Button* button3;
  Button* button4;
  Button* button5;
  Button* button6;
  Button* button7;
  Button* button8;
  Button* button9;
  Button* button0;
  Button* buttonDot;
  Button* buttonPoM;
  Button* buttonPercent;
  Button* buttonX;
  Button* buttonPlus;
  Button* buttonBS;
  Button* buttonDivide;
  Button* buttonSub;
  Button* buttonEqual;
  std::vector<std::string> operate_list;  //操作列表
  double result = 0;

  bool isTimeKeeping = false;  //是否正在计时
  std::chrono::system_clock::time_point start;

  void eventBind();
  void clickToInputButtonName(Button*& button);
  void clickToOperate(Button*& button);

 public:
  void init();
  void update();

};  // namespace Test

#endif